import {
  postData,
} from "@/api/common/index";

const baseUserBalanceInfo = "/api/user-balance-info";

const baseOrderInfo = "/api/wechat";

const userBalanceInfoUrl = {
  page: "/page",
  url: "",
  reduceMoney: "/reduceMoney",
  passOrder: "/notifyTest",
};

export function getUserBalanceInfoPage(params: any, pageNo: number | null | undefined, pageSize: number | null | undefined): Promise<any> {
  let url = baseUserBalanceInfo + userBalanceInfoUrl.page + "?pageNum=" + (pageNo ? pageNo : 1) + "&pageSize=" + (pageSize ? pageSize : 10);
  return postData(url, params);
}

// 消费现金
export function reduceMoneyInfo(params: any): Promise<any> {
  return postData(baseUserBalanceInfo + userBalanceInfoUrl.reduceMoney, params);
}

// 通过订单
export function passOrderInfo(params: any): Promise<any> {
  return postData(baseOrderInfo + userBalanceInfoUrl.passOrder, null, { params });
}
